import six
from six.moves import builtins
_property = builtins.property
_tuple = builtins.tuple
from operator import itemgetter as _itemgetter
class TocPageset(tuple):
    'TocPageset(label, pages)'

    __slots__ = ()

    _fields = ('label', 'pages')

    def __new__(_cls, label, pages):
        'Create new instance of TocPageset(label, pages)'
        return _tuple.__new__(_cls, (label, pages))

    @classmethod
    def _make(cls, iterable, new=tuple.__new__, len=len):
        'Make a new TocPageset object from a sequence or iterable'
        result = new(cls, iterable)
        if len(result) != 2:
            raise TypeError('Expected 2 arguments, got %d' % len(result))
        return result

    def __repr__(self):
        'Return a nicely formatted representation string'
        return self.__class__.__name__ + '(label=%r, pages=%r)' % self

    def _asdict(self):
        'Return a new OrderedDict which maps field names to their values'
        return OrderedDict(zip(self._fields, self))

    __dict__ = property(_asdict)

    def _replace(_self, **kwds):
        'Return a new TocPageset object replacing specified fields with new values'
        result = _self._make(map(kwds.pop, ('label', 'pages'), _self))
        if kwds:
            raise ValueError('Got unexpected field names: %r' % list(kwds))
        return result

    def __getnewargs__(self):
        'Return self as a plain tuple.  Used by copy and pickle.'
        return tuple(self)

    label = _property(_itemgetter(0), doc='Alias for field number 0')

    pages = _property(_itemgetter(1), doc='Alias for field number 1')
